package top.purity.server.tenant.feign.output;

import top.purity.framework.common.GlobalConstant;
import top.purity.framework.common.exception.ServiceException;
import top.purity.server.tenant.feign.output.dto.PermissionDTO;
import top.purity.server.tenant.feign.output.dto.TenantInfoDTO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * @version 1.0
 * @Author Lmh
 * @Description
 * @CreateTime 2023-09-24 20:29
 */
public interface TenantFeign {

    String PREFIX = GlobalConstant.RPC_PREFIX + "/tenant";

    @PostMapping(PREFIX + "/getByCode/{code}")
    TenantInfoDTO getByCode(@PathVariable("code") String code) throws ServiceException;

    @PostMapping(PREFIX + "/getMenuListByIds")
    List<PermissionDTO> getMenuListByIds(@RequestBody Set<Long> ids);

    @PostMapping(PREFIX + "/getMenuByPath")
    PermissionDTO getMenuByPath(@RequestParam("path") String path);

}
